package mytest;


import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class t1 {
    public static void main(String[] args) {
        List<HmeContainerImportVO> importVOList = new ArrayList<>();
        importVOList.add(new HmeContainerImportVO("  type1 ","rmk1"));
        importVOList.add(new HmeContainerImportVO("type2 ","rmk2 "));
        importVOList.add(new HmeContainerImportVO(" type3 ","rmk3"));

        importVOList.stream().map(t -> {
            t.setRemark(StringUtil.trim(t.getRemark()));
            t.setContainerTypeCode(StringUtil.trim((String)t.getContainerTypeCode()));
            return t;
        }).collect(Collectors.toList());

        System.out.println(JSONObject.toJSON(importVOList));



//        List<HmeContainerImportVO> collect = importVOList.stream().map(t -> {
//            System.out.println("-----------");
//            System.out.println(StringUtil.trim(t.getRemark()));
//            t.setRemark(StringUtil.trim(t.getRemark()));
//            System.out.println(t.getRemark());
//            System.out.println(StringUtil.trim((String) t.getContainerTypeCode()));
//            t.setContainerTypeCode(StringUtil.trim((String) t.getContainerTypeCode()));
//            System.out.println(t.getContainerTypeCode());
//            return t;
//        }).collect(Collectors.toList());
//
//        System.out.println(JSONObject.toJSON(importVOList));
//
//        System.out.println(JSONObject.toJSON(collect));
    }
}
